<?php
my_component_load('testing' , false);
my_component_load('xl_builder' , false);
my_component_load('paging' , false);
my_component_load('rpt_komponen_gaji', false);
include_once('components/'.$_GET['com'].'/cetak.rpt_komponen_gaji.php');
$modulname = "Reporting _BN_ Laporan Detail Komponen Gaji";
$komponen_id = isset($_GET['komponen_id']) ? (int) $_GET['komponen_id'] : 1000000;
$task = isset($_GET['task']) ?   $_GET['task'] : '';
$pagename = $modulname;

if($task == "cetak_report_komponen_gaji"){
	 
	if($komponen_id ==0){ 
		  cetak_laporan_thp($komponen_id); 
	}elseif($komponen_id ==1000){ 
		  cetak_laporan_gapok();
	}else{ 
		  cetak_laporan($komponen_id) ;
	}
	exit;
}elseif($task == "excel_report_komponen_gaji"){
	$item_name = my_get_data_by_id('pr_komponen_gaji','komponen_gaji_id',$komponen_id);
	header("Content-Type: application/xls");;
	if($komponen_id ==0){
		header("Content-Disposition: attachment;filename=item_take_home_pay.xls");
		echo xl_list_of_transfer();
	}elseif($komponen_id ==1000){
		header("Content-Disposition: attachment;filename=item_gaji_dibayar.xls");
		echo xl_list_of_gapok();
	}else{
		header("Content-Disposition: attachment;filename=item_".strtolower(str_replace(" ","_",$item_name['nama_komponen_gaji'])).".xls");
		echo excel_laporan($komponen_id) ;
	}
	exit;
}else{
	load_facebox_script();	
	$view = list_laporan($komponen_id);
	generate_my_web($view, $pagename );
}
?>